package com.mszlu.blog.controller;

import com.mszlu.blog.dao.pojo.Hobby;
import com.mszlu.blog.service.HobbyService;
import com.mszlu.blog.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Package: com.mszlu.blog.controller
 * @ClassName: HobbyController
 * @Author: 陈威
 * @CreateTime: 2021/12/28 22:00
 * @Description:
 */
@RestController()
@SuppressWarnings("all")
@RequestMapping("hobby")
public class HobbyController {

    @Autowired
    private HobbyService hobbyService;

    @PostMapping("setHobby/{token}")
    public Result setHobby(@PathVariable("token") String token, @RequestBody Hobby hobby) {


        return hobbyService.setHobby(hobby, token);
    }

    @PostMapping("getHobby/{token}")
    public Result getHobby(@PathVariable("token") String token) {
        return hobbyService.getHobby(token);

    }
}